#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <climits>


using namespace std;
class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};



class Solution {
public:
    
    void helper(Node* root,vector<int> &ans){
        if(root==nullptr){
            return;
        }
        ans.push_back(root->val);
        int len=root->children.size();
        for(int i=0;i<len;i++){
            if(root->children[i]){
                helper(root->children[i],ans);
            }
        }
    }
    vector<int> preorder(Node* root) {
        vector<int> ans;
        helper(root,ans);
        return ans;
    }
};


int main(){




    return 0;
}